package com.caration.shell.workspace3D;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ComposePathEffect;
import android.graphics.CornerPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathDashPathEffect;
import android.graphics.PathEffect;
import android.graphics.RectF;
import android.view.View;

public class ac extends View {
	private static PathEffect sPathEffect;
	private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
	private Path mPath;
	private float d;
	private float mWidth;
	private float mHeight;

	public ac(Context paramContext) {
		super(paramContext);
		mPaint.setStyle(Paint.Style.STROKE);
		mPaint.setStrokeWidth(6.0F);
		mPath = new Path();
		mPath.moveTo(0.0F, 0.0F);
	}

	protected final void onDraw(Canvas canvas) {
		RectF rectf = new RectF();
		mPath.computeBounds(rectf, false);
		canvas.translate(0.0F, mHeight / 2.0F - rectf.top);
		Path path = new Path();
		path.moveTo(0.0F, 0.0F);
		path.lineTo(0.0F, -4.0F);
		path.lineTo(8.0F, -4.0F);
		path.lineTo(12.0F, 0.0F);
		path.lineTo(8.0F, 4.0F);
		path.lineTo(0.0F, 4.0F);
		sPathEffect = new ComposePathEffect(new PathDashPathEffect(path, 12.0F,
				d, PathDashPathEffect.Style.ROTATE),
				new CornerPathEffect(10.0F));
		d--;
		invalidate();
		mPaint.setPathEffect(sPathEffect);
		// mPaint.setColor(x.e());TODO:
		canvas.drawPath(mPath, mPaint);
		canvas.translate(0.0F, 0.0F);
	}

	public final void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		mHeight = getHeight();
		mWidth = getWidth();
		mPath.lineTo(mWidth, 0.0F);
	}
}
